﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input.Touch;

namespace SuperRyoninRPG.Controller
{
	/// <summary>
	/// TouchCollection の拡張メソッドを提供します。
	/// </summary>
	public static class TouchCollectionExtensions
	{
		/// <summary>
		/// 画面上でタッチ入力があるかを
		/// </summary>
		/// <param name="touchState">現在の TouchCollection。</param>
		/// <returns>Pressed もしくは Moved ステートのタッチ入力がある場合は true、無い場合は false。</returns>
		public static bool AnyTouch(this TouchCollection touchState)
		{
			foreach (TouchLocation location in touchState)
			{
				if (location.State == TouchLocationState.Pressed || location.State == TouchLocationState.Moved)
				{
					return true;
				}
			}
			return false;
		}
	}
}
